home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gas / gassrc02.zoo / sparc-opcode.h < prev    next >
C/C++ Source or Header  |  1991-01-24  |  30KB  |  637 lines

  1. /* Table of opcodes for the sparc.
  2.    Copyright (C) 1989 Free Software Foundation, Inc.
  3.  
  4. This file is part of GAS, the GNU Assembler, and GDB, the GNU disassembler.
  5.  
  6. GAS/GDB is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GAS/GDB is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GAS or GDB; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #if !defined(__STDC__) && !defined(const)
  21. #define const
  22. #endif
  23.  
  24. /*
  25.  * Structure of an opcode table entry.
  26.  */
  27. struct sparc_opcode
  28. {
  29.     const char *name;
  30.     unsigned long int match;    /* Bits that must be set.  */
  31.     unsigned long int lose;    /* Bits that must not be set.  */
  32.     const char *args;
  33.     /* Nonzero if this is a delayed branch instruction.  */
  34.     char delayed;
  35. };
  36.  
  37. /*
  38.    All sparc opcodes are 32 bits, except for the `set' instruction (really
  39.    a macro), which is 64 bits.  It is handled as a special case.
  40.  
  41.    The match component is a mask saying which bits must match a
  42.    particular opcode in order for an instruction to be an instance
  43.    of that opcode.
  44.  
  45.    The args component is a string containing one character
  46.    for each operand of the instruction.
  47.  
  48. Kinds of operands:
  49.    #    Number used by optimizer.  It is ignored.
  50.    1    rs1 register.
  51.    2    rs2 register.
  52.    d    rd register.
  53.    e    frs1 floating point register.
  54.    f    frs2 floating point register.
  55.    g    frsd floating point register.
  56.    b    crs1 coprocessor register
  57.    c    crs2 coprocessor register
  58.    D    crsd coprocessor register
  59.    h    22 high bits.
  60.    i    13 bit Immediate.
  61.    l    22 bit PC relative immediate.
  62.    L    30 bit PC relative immediate.
  63.    a    Annul.  The annul bit is set.
  64.    A    Alternate address space.  Stored as 8 bits.
  65.    C    Coprocessor state register.
  66.    F    floating point state register.
  67.    p    Processor state register.
  68.    q    Floating point queue.
  69.    r    Single register that is both rs1 and rsd.
  70.    Q    Coprocessor queue.
  71.    S    Special case.
  72.    t    Trap base register.
  73.    w    Window invalid mask register.
  74.    y    Y register.
  75.  
  76. */
  77.  
  78. /* The order of the opcodes in this table is significant:
  79.    
  80.    * The assembler requires that all instances of the same mnemonic must be
  81.    consecutive.  If they aren't, the assembler will bomb at runtime.
  82.  
  83.    * The disassembler should not care about the order of the opcodes.  */
  84.  
  85. static struct sparc_opcode sparc_opcodes[] =
  86. {
  87.  
  88. { "ldd",        0xc1980000, 0x0060201f, "[1],D", 0 }, /* ldd [rs1+%g0],d */
  89. { "ldd",        0xc1982000, 0x00601fff, "[1],D", 0 }, /* ldd [rs1+0],d */
  90. { "ldd",        0xc1982000, 0x00600000, "[1+i],D", 0 },
  91. { "ldd",        0xc1982000, 0x00600000, "[i+1],D", 0 },
  92. { "ldd",        0xc1980000, 0x00602000, "[1+2],D", 0 },
  93. { "ldd",        0xc1180000, 0x00e0201f, "[1],g", 0 }, /* ldd [rs1+%g0],d */
  94. { "ldd",        0xc1182000, 0x00e01fff, "[1],g", 0 }, /* ldd [rs1+0],d */
  95. { "ldd",        0xc1182000, 0x00e00000, "[1+i],g", 0 },
  96. { "ldd",        0xc1182000, 0x00e00000, "[i+1],g", 0 },
  97. { "ldd",        0xc1180000, 0x00e02000, "[1+2],g", 0 },
  98. { "ldd",    0xc0180000, 0x01e0201f, "[1],d", 0 }, /* ldd [rs1+%g0],d */
  99. { "ldd",        0xc0182000, 0x01e01fff, "[1],d", 0 }, /* ldd [rs1+0],d */
  100. { "ldd",    0xc0182000, 0x01e00000, "[1+i],d", 0 },
  101. { "ldd",    0xc0182000, 0x01e00000, "[i+1],d", 0 },
  102. { "ldd",    0xc0180000, 0x01e02000, "[1+2],d", 0 },
  103. { "ld",         0xc1880000, 0x0070201f, "[1],C", 0 }, /* ld [rs1+%g0],d */
  104. { "ld",         0xc1882000, 0x00701fff, "[1],C", 0 }, /* ld [rs1+0],d */
  105. { "ld",         0xc1882000, 0x00700000, "[1+i],C", 0 },
  106. { "ld",         0xc1882000, 0x00700000, "[i+1],C", 0 },
  107. { "ld",         0xc1880000, 0x00702000, "[1+2],C", 0 },
  108. { "ld",         0xc1800000, 0x0078201f, "[1],D", 0 }, /* ld [rs1+%g0],d */
  109. { "ld",         0xc1802000, 0x00781fff, "[1],D", 0 }, /* ld [rs1+0],d */
  110. { "ld",         0xc1802000, 0x00780000, "[1+i],D", 0 },
  111. { "ld",         0xc1802000, 0x00780000, "[i+1],D", 0 },
  112. { "ld",         0xc1800000, 0x00782000, "[1+2],D", 0 },
  113. { "ld",         0xc1080000, 0x00f0201f, "[1],F", 0 }, /* ld [rs1+%g0],d */
  114. { "ld",         0xc1082000, 0x00f01fff, "[1],F", 0 }, /* ld [rs1+0],d */
  115. { "ld",         0xc1082000, 0x00f00000, "[1+i],F", 0 },
  116. { "ld",         0xc1082000, 0x00f00000, "[i+1],F", 0 },
  117. { "ld",         0xc1080000, 0x00f02000, "[1+2],F", 0 },
  118. { "ld",         0xc1000000, 0x00f8201f, "[1],g", 0 }, /* ld [rs1+%g0],d */
  119. { "ld",         0xc1002000, 0x00f81fff, "[1],g", 0 }, /* ld [rs1+0],d */
  120. { "ld",         0xc1002000, 0x00f80000, "[1+i],g", 0 },
  121. { "ld",         0xc1002000, 0x00f80000, "[i+1],g", 0 },
  122. { "ld",         0xc1000000, 0x00f82000, "[1+2],g", 0 },
  123. { "ld",            0xc0000000, 0x01f8201f, "[1],d", 0 }, /* ld [rs1+%g0],d */
  124. { "ld",        0xc0002000, 0x01f81fff, "[1],d", 0 }, /* ld [rs1+0],d */
  125. { "ld",        0xc0002000, 0x01f80000, "[1+i],d", 0 },
  126. { "ld",        0xc0002000, 0x01f80000, "[i+1],d", 0 },
  127. { "ld",        0xc0000000, 0x01f82000, "[1+2],d", 0 },
  128. { "ldstuba",    0xc0d80000, 0x0100201f, "[1]A,d", 0 }, /* ldstuba [rs1+%g0],d */
  129. { "ldstuba",    0xc0d80000, 0x01002000, "[1+2]A,d", 0 },
  130. { "ldsha",      0xc0d00000, 0x0128201f, "[1]A,d", 0 }, /* ldsha [rs1+%g0],d */
  131. { "ldsha",    0xc0d00000, 0x01282000, "[1+2]A,d", 0 },
  132. { "ldsba",      0xc0c80000, 0x0130201f, "[1]A,d", 0 }, /* ldsba [rs1+%g0],d */
  133. { "ldsba",    0xc0c80000, 0x01302000, "[1+2]A,d", 0 },
  134. { "ldda",       0xc0980000, 0x0160201f, "[1]A,d", 0 }, /* ldda [rs1+%g0],d */
  135. { "ldda",    0xc0980000, 0x01602000, "[1+2]A,d", 0 },
  136. { "lduha",      0xc0900000, 0x0168201f, "[1]A,d", 0 }, /* lduha [rs1+%g0],d */
  137. { "lduha",    0xc0900000, 0x01682000, "[1+2]A,d", 0 },
  138. { "ldstub",     0xc0680000, 0x0190201f, "[1],d", 0 }, /* ldstub [rs1+%g0],d */
  139. { "ldstub",    0xc0682000, 0x01900000, "[1+i],d", 0 },
  140. { "ldstub",    0xc0682000, 0x01900000, "[i+1],d", 0 },
  141. { "ldstub",    0xc0680000, 0x01902000, "[1+2],d", 0 },
  142. { "lda",        0xc0800000, 0x0178201f, "[1]A,d", 0 }, /* lda [rs1+%g0],d */
  143. { "lda",    0xc0800000, 0x01782000, "[1+2]A,d", 0 },
  144. { "ldsh",       0xc0500000, 0x0000000d, "[1],d", 0 }, /* ldsh [rs1+%g0],d */
  145. { "ldsh",       0xc0502000, 0x01a81fff, "[1],d", 0 }, /* ldsh [rs1+0],d */
  146. { "ldsh",    0xc0502000, 0x01a80000, "[1+i],d", 0 },
  147. { "ldsh",    0xc0502000, 0x01a80000, "[i+1],d", 0 },
  148. { "ldsh",    0xc0500000, 0x01a82000, "[1+2],d", 0 },
  149. { "ldsb",       0xc0480000, 0x01b0201f, "[1],d", 0 }, /* ldsb [rs1+%g0],d */
  150. { "ldsb",    0xc0482000, 0x01b01fff, "[1],d", 0 }, /* ldsb [rs1+0],d */
  151. { "ldsb",    0xc0482000, 0x01b00000, "[1+i],d", 0 },
  152. { "ldsb",    0xc0482000, 0x01b00000, "[i+1],d", 0 },
  153. { "ldsb",    0xc0480000, 0x01b02000, "[1+2],d", 0 },
  154. { "ldub",       0xc0080000, 0x01f0201f, "[1],d", 0 }, /* ldub [rs1+%g0],d */
  155. { "ldub",       0xc0082000, 0x01f01fff, "[1],d", 0 }, /* ldub [rs1+0],d */
  156. { "ldub",    0xc0082000, 0x01f00000, "[1+i],d", 0 },
  157. { "ldub",    0xc0082000, 0x01f00000, "[i+1],d", 0 },
  158. { "ldub",    0xc0080000, 0x01f02000, "[1+2],d", 0 },
  159. { "lduba",      0xc0880000, 0x0170201f, "[1]A,d", 0 }, /* lduba [rs1+%g0],d */
  160. { "lduba",    0xc0880000, 0x01702000, "[1+2]A,d", 0 },
  161. { "lduh",    0xc0102000, 0x01e80000, "[1+i],d", 0 },
  162. { "lduh",    0xc0102000, 0x01e80000, "[i+1],d", 0 },
  163. { "lduh",    0xc0100000, 0x01e8201f, "[1],d", 0 }, /* lduh [rs1+%g0],d */
  164. { "lduh",    0xc0102000, 0x01e81fff, "[1],d", 0 }, /* lduh [rs1+0],d */
  165. { "lduh",    0xc0100000, 0x01e82000, "[1+2],d", 0 },
  166.  
  167. { "st",            0xc0200000, 0x01d8201f, "d,[1]", 0 }, /* st d,[rs1+%g0] */
  168. { "st",            0xc0202000, 0x01d81fff, "d,[1]", 0 }, /* st d,[rs1+0] */
  169. { "st",        0xc0202000, 0x01d80000, "d,[1+i]", 0 },
  170. { "st",        0xc0202000, 0x01d80000, "d,[i+1]", 0 },
  171. { "st",        0xc0200000, 0x01d82000, "d,[1+2]", 0 },
  172. { "st",        0xc1200000, 0x00d8201f, "g,[1]", 0 }, /* st d[rs1+%g0] */
  173. { "st",        0xc1202000, 0x00d81fff, "g,[1]", 0 }, /* st d,[rs1+0] */
  174. { "st",        0xc1202000, 0x00d80000, "g,[1+i]", 0 },
  175. { "st",        0xc1202000, 0x00d80000, "g,[i+1]", 0 },
  176. { "st",        0xc1200000, 0x00d82